<?php

function printFileMIME($path)
{
    $ext = explode(".",$path);
    if($ext > 1)
    {
        $count = count($ext);
        $ext_string = $ext[$count-1];
        
        if($ext_string=="jpg"  )
        {
            header('Content-Type: image/jpeg');
            return;
        }
        else if($ext_string=="html"  )
        {
            header('Content-Type: text/html');
            return;
        } 
        else if($ext_string=="txt"  )
        {
            header('Content-Type: text/plain');
            return;
        } 
        else if($ext_string=="pdf"  )
        {
            header('Content-Type: application/pdf');
            return;
        } 
        else if($ext_string=="zip"  )
        {
            header('Content-Type: application/zip');
            return;
        } 
        else
		{
			header('Content-Type: text/plain');
            return 0;
		}

    }
}

?>
